package com.zhouyilin.bigevent2.config;

import com.zhouyilin.bigevent2.interceptions.LogginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LogginInterceptor logginInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        放行登录和注册接口
       registry.addInterceptor(logginInterceptor).excludePathPatterns("/user/login","user/register");
    }
}
